Previous Book Contents Book Index Next

Inside Macintosh: AppleScript Language Guide / Part 3 - Appendixes
Appendix A - The Language at a Glance


Handlers

Handlers are collections of statements that are executed in response to commands or error messages. Table A-6 summarizes handler definitions
and subroutine calls.
Handler definitions and calls
HandlerSyntax
Subroutine definition (labeled parameters)( on | to ) subroutineName ¬
[ of | in directParameterVariable ] ¬
[ subroutineParamLabel paramVariable ] ... ¬
[ given label:paramVariable [, label:paramVariable ]...]
[ global variable [, variable ]...]
[ local variable [, variable ]...]
[ statement ]...
end [ subroutineName ]
Subroutine call (labeled parameters)subroutineName ¬
[ ( of | in ) directParameter ] ¬
[ subroutineParamLabel parameterValue ] ¬
| [ with labelForTrueParam [, labelForTrueParam ]... ¬
[( and | or | , ) labelForTrueParam ] ] ¬
| [ without labelForFalseParam [, labelForFalseParam ]... ¬
[( and | or | , ) labelForFalseParam ] ] ¬
| [ given label:parameterValue ¬
[, label:parameterValue ]...] ] ...
Subroutine definition (positional parameters)( on | to ) subroutineName ( [ paramVariable [, paramVariable ]...] )
[ global variable [, variable ]...]
[ local variable [, variable ]...]
[ statement ]...
end [ subroutineName ]
Subroutine call (positional parameters)subroutineName ( [ parameterValue [, parameterValue ]...] )
Return statementreturn expression
Command handler definition( on | to ) commandName ¬
[ [ of ] directParameterVariable ] ¬
[ [ given ] label:paramVariable [, label:paramVariable ]...]
[ global variable [, variable ]...]
[ local variable [, variable ]...]
[ statement ]...
end [ commandName ]


Previous Book Contents Book Index Next

© Apple Computer, Inc.
13 JUL 1996